/**
 * ReportGear(2011)
 */
package com.reportgear.report.print.pane;

import java.awt.BorderLayout;
import java.awt.Window;

import javax.swing.JTabbedPane;

import com.reportgear.core.swing.pane.base.JBasePane;
import com.reportgear.report.model.ReportModel;

/**
 * 对话框-页面设置
 * 
 * @version 1.0 2011-4-20
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class PageSetupPane extends JBasePane {
	/**
	 * UID
	 */
	private static final long serialVersionUID = -3198806897384774174L;
	private PagePane pagePane;

	public PageSetupPane() {
		this.initComponents();
	}

	private void initComponents() {
		this.setLayout(new BorderLayout());

		JTabbedPane tabPane = new JTabbedPane();
		this.add(tabPane, BorderLayout.CENTER);

		this.pagePane = new PagePane();
		tabPane.addTab("页面", this.pagePane);
	}

	public int showDialog(Window owner) {
		return this.showDialog(owner, "页面设置", 370, 440);
	}

	public void populate(ReportModel model) {
		if (model == null)
			return;

		this.pagePane.populate(model);
	}

	public void update(ReportModel model) {
		if (model == null)
			return;

		this.pagePane.update(model);
	}
}